package com.xxx.video.common.dbs.greendao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.xxx.video.commen.dbs.beans.DownloadHistoryBean;
import com.xxx.video.commen.dbs.beans.SearchFriendHistoryBean;
import com.xxx.video.commen.dbs.beans.SearchHistoryBean;
import com.xxx.video.commen.dbs.beans.UploadFileBean;

import com.xxx.video.common.dbs.greendao.DownloadHistoryBeanDao;
import com.xxx.video.common.dbs.greendao.SearchFriendHistoryBeanDao;
import com.xxx.video.common.dbs.greendao.SearchHistoryBeanDao;
import com.xxx.video.common.dbs.greendao.UploadFileBeanDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig downloadHistoryBeanDaoConfig;
    private final DaoConfig searchFriendHistoryBeanDaoConfig;
    private final DaoConfig searchHistoryBeanDaoConfig;
    private final DaoConfig uploadFileBeanDaoConfig;

    private final DownloadHistoryBeanDao downloadHistoryBeanDao;
    private final SearchFriendHistoryBeanDao searchFriendHistoryBeanDao;
    private final SearchHistoryBeanDao searchHistoryBeanDao;
    private final UploadFileBeanDao uploadFileBeanDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        downloadHistoryBeanDaoConfig = daoConfigMap.get(DownloadHistoryBeanDao.class).clone();
        downloadHistoryBeanDaoConfig.initIdentityScope(type);

        searchFriendHistoryBeanDaoConfig = daoConfigMap.get(SearchFriendHistoryBeanDao.class).clone();
        searchFriendHistoryBeanDaoConfig.initIdentityScope(type);

        searchHistoryBeanDaoConfig = daoConfigMap.get(SearchHistoryBeanDao.class).clone();
        searchHistoryBeanDaoConfig.initIdentityScope(type);

        uploadFileBeanDaoConfig = daoConfigMap.get(UploadFileBeanDao.class).clone();
        uploadFileBeanDaoConfig.initIdentityScope(type);

        downloadHistoryBeanDao = new DownloadHistoryBeanDao(downloadHistoryBeanDaoConfig, this);
        searchFriendHistoryBeanDao = new SearchFriendHistoryBeanDao(searchFriendHistoryBeanDaoConfig, this);
        searchHistoryBeanDao = new SearchHistoryBeanDao(searchHistoryBeanDaoConfig, this);
        uploadFileBeanDao = new UploadFileBeanDao(uploadFileBeanDaoConfig, this);

        registerDao(DownloadHistoryBean.class, downloadHistoryBeanDao);
        registerDao(SearchFriendHistoryBean.class, searchFriendHistoryBeanDao);
        registerDao(SearchHistoryBean.class, searchHistoryBeanDao);
        registerDao(UploadFileBean.class, uploadFileBeanDao);
    }
    
    public void clear() {
        downloadHistoryBeanDaoConfig.clearIdentityScope();
        searchFriendHistoryBeanDaoConfig.clearIdentityScope();
        searchHistoryBeanDaoConfig.clearIdentityScope();
        uploadFileBeanDaoConfig.clearIdentityScope();
    }

    public DownloadHistoryBeanDao getDownloadHistoryBeanDao() {
        return downloadHistoryBeanDao;
    }

    public SearchFriendHistoryBeanDao getSearchFriendHistoryBeanDao() {
        return searchFriendHistoryBeanDao;
    }

    public SearchHistoryBeanDao getSearchHistoryBeanDao() {
        return searchHistoryBeanDao;
    }

    public UploadFileBeanDao getUploadFileBeanDao() {
        return uploadFileBeanDao;
    }

}
